﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="clr-namespace:ToyundaPhone.Controls" xmlns:SampleData="clr-namespace:Expression.Blend.SampleData.SongsDataSource" xmlns:SampleData1="clr-namespace:Expression.Blend.SampleData.PlaylistsDataSource" xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" x:Name="phoneApplicationPage" 
    x:Class="ToyundaPhone.Pages.SongSearchPage"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True" Loaded="PhoneApplicationPage_Loaded" OrientationChanged="PhoneApplicationPage_OrientationChanged">

	<phone:PhoneApplicationPage.Resources>
		<SampleData:SongsDataSource x:Key="SongsDataSource" d:IsDataSource="True"/>
		<SampleData1:PlaylistsDataSource x:Key="PlaylistsDataSource" d:IsDataSource="True"/>
	</phone:PhoneApplicationPage.Resources>

	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

		<controls:SongSearchControl x:Name="Search" ApplicationName="{StaticResource ApplicationNameUC}" Hint="rechercher dans la liste" TextChanged="Search_TextChanged" />

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto" />
				<RowDefinition />
			</Grid.RowDefinitions>
			<TextBlock Text="{Binding Name}" d:DataContext="{Binding Playlists[0], Source={StaticResource PlaylistsDataSource}}" DataContext="{Binding Playlist, ElementName=phoneApplicationPage}" FontSize="{StaticResource PhoneFontSizeMediumLarge}" Foreground="{StaticResource PhoneAccentBrush}" />
			<controls:SongListControl x:Name="songList" Grid.Row="1" d:DataContext="{Binding Source={StaticResource SongsDataSource}}" DataContext="{Binding ElementName=phoneApplicationPage}" Search="{Binding Text, ElementName=Search}" EmptyForeground="{StaticResource PhoneForegroundBrush}" EmptyText="Rien à afficher." Playlist="{Binding Playlist, ElementName=phoneApplicationPage}"/>
		</Grid>
    </Grid>
</phone:PhoneApplicationPage>
